package me.kany.project.spring.boot.model;


import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;

import me.kany.utils.model.pageinfo.BaseEntity;

/**
 * BlogDoc entity.
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "blog_doc", catalog = "honey_blog")
public class BlogDoc extends BaseEntity implements java.io.Serializable {

	// Fields

	private Integer docId;
	private Integer userId;
	private String title;
	private String keywords;
	private String content;
	private Integer status;
	private Integer ispub;
	private Date createtime;

	// Constructors

	/** default constructor */
	public BlogDoc() {
	}

	/** minimal constructor */
	public BlogDoc(Integer userId, String title, String keywords,
			String content, Integer status, Integer ispub) {
		this.userId = userId;
		this.title = title;
		this.keywords = keywords;
		this.content = content;
		this.status = status;
		this.ispub = ispub;
	}

	/** full constructor */
	public BlogDoc(Integer userId, String title, String keywords,
			String content, Integer status, Integer ispub, Date createtime) {
		this.userId = userId;
		this.title = title;
		this.keywords = keywords;
		this.content = content;
		this.status = status;
		this.ispub = ispub;
		this.createtime = createtime;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "doc_id", unique = true, nullable = false)
	public Integer getDocId() {
		return this.docId;
	}

	public void setDocId(Integer docId) {
		this.docId = docId;
	}

	@Column(name = "user_id", nullable = false)
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "title", nullable = false, length = 100)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "keywords", nullable = false, length = 100)
	public String getKeywords() {
		return this.keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

	@Column(name = "content", nullable = false, length = 65535)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "status", nullable = false)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "ispub", nullable = false)
	public Integer getIspub() {
		return this.ispub;
	}

	public void setIspub(Integer ispub) {
		this.ispub = ispub;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
	@Column(name = "createtime", length = 19)
	public Date getCreatetime() {
		return this.createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

}